﻿
namespace Bright.NetCore.Api.Middleware
{
    /// <summary>
    /// 入参验证中间件
    /// </summary>
    public static class InputValidationMiddlewareExtensions
    {
        /// <summary>
        /// 注册入参验证中间件
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static IApplicationBuilder UseInputValidationMiddleware(this IApplicationBuilder builder)
        {
            return builder.UseMiddleware<InputDecryptionMiddleware>();
        }
    }
    /// <summary>
    /// 返回值加密中间件
    /// </summary>
    public static class ReturnValueEncryptionMiddlewareExtensions
    {
        /// <summary>
        /// 返回值处理中间件
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static IApplicationBuilder UseResponseHandlingMiddleware(this IApplicationBuilder builder)
        {
            return builder.UseMiddleware<ReturnValueEncryptionMiddleware>();
        }
    }
}
